$nav_height: 88px;

.mainnav_content {
  position: relative;
  z-index: 3;
}

// 宽度1226px
.main_nav {
  height: $nav_height;
  display: flex;
  align-items: center;

  // 小米logo 宽度共：234px
  .logo_box {
    position: relative;
    width: 56px;
    height: 56px;
    background-color: $theme-color;
    overflow: hidden;
    cursor: pointer;

    .icon_box {
      position: absolute;
      left: -56px;
      display: flex;
      transition: left 0.2s linear;

      .logo_icon {
        width: 30px;
        height: 30px;
        margin: 13px;
      }
    }

    &:hover {
      .icon_box {
        left: 0px;
      }
    }
  }

  // 选项navbar 696px
  .main_navbar {
    width: 696px;
    height: $nav_height;
    margin-left: 178px;

    .navbar_ul {
      list-style: none;
      line-height: $nav_height;
      display: flex;

      li {
        padding: 0 10px;
        transition: color 0.3s;
        cursor: pointer;

        &:hover {
          color: $theme-color;
        }

        .recom_show {
          position: absolute;
          left: 0;
          width: 100%;
          height: 0px;
          transition: height 0.3s linear;
          overflow: hidden;
          box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
          z-index: 1;
        }

        &:hover .recom_show {
          height: 229px;
        }
      }
    }
  }

  // 搜索 296px
  .search_box {
    width: 296px;
    height: $nav_height;
    display: flex;
    align-items: center;

    .search {
      width: 100%;
      height: 48px;
      position: relative;

      .input_box {
        position: absolute;
        left: 0;
        top: 0;
        width: 223px;
        height: 48px;
        border: $border;
        border-right: none;
        padding: 0 10px;
        outline: none;
        margin: 0;
        transition: all 0.2s;

        &:focus,
        &:focus~.search_btn {
          border: 1px solid $theme-color;
        }

        &:focus~.search_info {
          opacity: 0;
        }

        &:focus~.search_history {
          display: block;
        }
      }

      .search_btn {
        position: absolute;
        right: 0;
        width: 50px;
        height: 48px;
        display: flex;
        justify-content: center;
        align-items: center;
        border: $border;
        cursor: pointer;
        transition: all 0.2s;
        background-color: #fff;
        color: #616161;

        i {
          font-size: 20px;
        }

        &:hover {
          background-color: $theme-color;
          color: #fff;
          border: 1px solid $theme-color;
        }
      }

      .search_info {
        position: absolute;
        right: 55px;
        top: 0;
        opacity: 1;
        transition: opacity 0.2s;

        ul {
          height: 48px;
          display: flex;
          align-items: center;

          li {
            display: inline-block;
            list-style: none;
            padding: 0px 5px;
            font-size: 12px;
            background: #eee;
            color: #757575;
            margin-right: 4px;
            cursor: pointer;
            transition: all 0.2s;

            &:hover {
              background-color: $theme-color;
              color: #fff;
            }
          }
        }
      }

      .search_history {
        position: absolute;
        top: 50px;
        left: 0;
        width: 243px;
        border: 1px solid $theme-color;
        border-top: none;
        display: none;
        padding: 0;

        ul {
          padding: 0;
          margin: 0;

          li {
            list-style: none;
            font-size: 12px;
            color: #424242;
            padding: 6px 12px;
            margin: 0;
            background-color: #fff;

            &:hover {
              background-color: #f9f9f9;
            }
          }
        }
      }
    }
  }
}